﻿using System.IO;

namespace Raven
{
    public class GraphEdge
    {
        protected int _from;
        protected int _to;
        protected Fix _cost;

        public int From()
        {
            return _from;
        }

        public int To()
        {
            return _to;
        }

        public Fix Cost()
        {
            return _cost;
        }

        public void SetFrom(int newIndex)
        {
            _from = newIndex;
        }

        public void SetTo(int newIndex)
        {
            _to = newIndex;
        }

        public void SetCost(Fix newCost)
        {
            _cost = newCost;
        }

        public GraphEdge()
        {
        }

        public GraphEdge(BinaryReader reader)
        {
        }
    }

    public class NavGraphEdge : GraphEdge
    {
        public NavGraphEdge()
        {
        }


        public NavGraphEdge(BinaryReader reader) : base(reader)
        {
            _from = reader.ReadInt32();
            _to = reader.ReadInt32();
            _cost = new Fix(reader.ReadInt32());
        }
    }
}